package net;

import java.io.IOException;
import java.io.PrintStream;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * 服务端
 */
public class Service {
    public static void main(String[] args) throws IOException, InterruptedException {
        ServerSocket serverSocket = new ServerSocket(8080);

        while (true) {
            Socket socket = serverSocket.accept();

           /* BufferedReader reader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
            String accept = reader.readLine();*/
            PrintStream ps = new PrintStream(socket.getOutputStream());
            ps.print("我是服务端消息");

            ps.close();
            socket.close();
        }
    }
}
